/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.design_patterns.decorator;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/4/17 9:04
 */
// 定义不同的装饰器
public class ConcreteDecorator1 extends Decorator {
    public ConcreteDecorator1(Component component) {
        super(component);
    }

    private void method1(){
        System.out.println("this is method1 in ConcreteDecorator1");
    }

    private void method2(){
        System.out.println("this is method2 in ConcreteDecorator1");
    }

    // 进行装饰
    @Override
    public void component() {
        method1();
        super.component();
        method2();
    }
}
